package com.greenDao.activity.tool.button.movie;

import android.app.Activity;
import android.view.View;

import com.greenDao.activity.tool.DatabaseUtils;
import com.greenDao.pojo.Movie;

public class RemoveMovieButton implements View.OnClickListener {

	private final Activity activity;
	private final Movie movie;

	public RemoveMovieButton(Activity activity, Movie movie) {
		this.activity = activity;
		this.movie = movie;
	}

	@Override
	public void onClick(View v) {
		DatabaseUtils.removeMovie(movie);
		activity.finish();
		activity.startActivity(activity.getIntent());
	}
}
